import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while (true) {
			String str = br.readLine();
			if(str == null) {
				break;
			}
			
			StringBuffer sb = new StringBuffer();
			int index = 0;
			
			boolean startOneBlock = false;
			while(index < str.length()) {
				char c = str.charAt(index);
				int count = 0;
				while(index < str.length() && str.charAt(index) == c) {
					index++;
					count++;
					if(count == 9) {
						break;
					}
				}
				if(count == 1) {
					if(!startOneBlock) {
						startOneBlock = true;
						sb.append('1');
					}
					if(c == '1') {
						sb.append("11");
					} else {
						sb.append(c);
					}
				} else {
					if(startOneBlock) {
						sb.append('1');
						startOneBlock = false;
					}
					sb.append(count);
					sb.append(c);
				}
			}
			if(startOneBlock) {
				sb.append('1');
			}
			System.out.println(sb);
		}
	}
}
